package com.fhz.day002;

import androidx.annotation.NonNull;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleEventObserver;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.OnLifecycleEvent;
import androidx.lifecycle.ViewModel;

/**
 * 时间:2022/5/20
 *
 * @author msfeng
 * 简述: TODO
 */
public class MyLifeView implements LifecycleEventObserver {

    @Override
    public void onStateChanged(@NonNull LifecycleOwner source, @NonNull Lifecycle.Event event) {
        if(source.getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.CREATED)){
            System.out.println("create");
        }
    }
}

